const FsExtra = require('fs-extra');
const Fs = require('fs')
const Path = require('path')
let sourceDir = 'I:\\project\\edu-project\\build\\web-mobile\\assets'; // 打包后的项目路径
let descDir = Path.join(__dirname, '../lessons');
FsExtra.emptyDirSync(descDir);
if (Fs.existsSync(sourceDir) && Fs.existsSync(descDir)) {
    FsExtra.copySync(sourceDir, descDir);

    function renameBundle(name) {
        let oldPath = `${descDir}/${name}`
        if (Fs.existsSync(oldPath)) {
            FsExtra.renameSync(oldPath, `${descDir}/${name}-ice`)
        }
    }

    renameBundle('main')
    renameBundle('internal')
    renameBundle('resources')
}

